class Enum(object):
    def __init__(self, names):
        self.names = names
        for index, name in enumerate(names):
            setattr(self, name, index)

    def __len__(self):
        return len(self.names)

    def __contains__(self, value):
        if value < 0:
            return False
        if value > (len(self) - 1):
            return False
        return True

